package SwingUiChatting;

import java.util.logging.Handler;

public class SwingTest {
    public static void main(String[] args) {
        ClientSwingUI clientSwingUI=new ClientSwingUI();
     //   clientSwingUI.recordPane.append("hello");
     //   clientSwingUI.showMsg("world");
        if (clientSwingUI.isClicked()){
            String input= clientSwingUI.getInput();
            System.out.println(input);
            String systemMessage = clientSwingUI.getSystemMessage();
            //将点击的要求进行重置
            System.out.println(systemMessage);
            clientSwingUI.setClicked(false);
        }



        class HandleSend implements Runnable{

            public HandleSend(){
                new Thread(this).start();
            }

            @Override
            public void run() {
                while (true){
                    if (clientSwingUI.isClicked()) {
                        String input = clientSwingUI.getInput();
                        System.out.println(input);
                        String systemMessage = clientSwingUI.getSystemMessage();
                        System.out.println(systemMessage);
                    }
                }

            }
        }
    }
}
